<template>
  <div class="setting-main">
    <nav-bar :title="$t('h.A041')"></nav-bar>
    <div class="setting-box-cell">
<!--      登录密码-->
      <van-cell :title="$t('h.A042')" to="resetPwd" is-link />
<!--      资金密码 未设置-->
<!--      <van-cell :title="$t('h.A043')" to="fundPassword" is-link :value="$t('h.A045')" />-->
<!--      收货地址-->
      <van-cell :title="$t('h.A044')" to="address" is-link />
    </div>

    <div class="setting-box">
<!--      退出-->
      <van-button style="border-radius: 5px" @click="goOut" block color="#002FFF">{{ $t('h.A046') }}</van-button>
    </div>
  </div>
</template>

<script>
  import {loginOut} from "@/api/apiFox";
  import NavBar from '@/components/NavBar/index.vue';
  export default {
    components: {
      NavBar,
    },
    methods:{
      goBack(){
        this.$router.go(-1)
      },
      goOut(){
        loginOut().then(res=>{
          this.$store.dispatch('removeTokenItem')
          this.$router.push('/login')
          setTimeout(()=>{
            // location.reload()
          },600)

        }).catch(err=>{})
      }
    }
  }
</script>

<style scoped lang="scss">
.setting-main{
  width: 100%;
  padding:0 3%;
  box-sizing: border-box;
  .setting-header{
    width: 100%;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    span{
      position: absolute;
      left: 0;
    }
    .center{
      width: 100%;
      height: 45px;
      text-align: center;
      line-height: 45px;
      font-size: 15px;
    }
  }
  .setting-box-cell{
    width: 100%;
  }
  .setting-box{
    margin-top: 20px;
  }
}

</style>
